home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-24 | 11.7 KB | 443 lines | [TEXT/MPS ] |
- ;
- ; File: Fonts.a
- ;
- ; Contains: Font Manager Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Package: Universal Interfaces 2.2 in “MPW” on ETO #20
- ;
- ; Copyright: © 1984-1995 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- ; stack. Include the file and version information (from above)
- ; in the problem description and send to:
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__FONTS__') = 'UNDEFINED' THEN
- __FONTS__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- systemFont EQU 0
- applFont EQU 1
- newYork EQU 2
- geneva EQU 3
- monaco EQU 4
- venice EQU 5
- london EQU 6
- athens EQU 7
- sanFran EQU 8
- toronto EQU 9
- cairo EQU 11
- losAngeles EQU 12
- times EQU 20
- helvetica EQU 21
- courier EQU 22
- symbol EQU 23
- mobile EQU 24
- commandMark EQU 17
- checkMark EQU 18
- diamondMark EQU 19
-
- appleMark EQU 20
- propFont EQU 36864
- prpFntH EQU 36865
- prpFntW EQU 36866
- prpFntHW EQU 36867
- fixedFont EQU 45056
- fxdFntH EQU 45057
- fxdFntW EQU 45058
- fxdFntHW EQU 45059
- fontWid EQU 44208
-
- FMInput RECORD 0
- family ds.w 1 ; offset: $0 (0)
- size ds.w 1 ; offset: $2 (2)
- face ds.b 1 ; offset: $4 (4)
- needBits ds.b 1 ; offset: $5 (5)
- device ds.w 1 ; offset: $6 (6)
- numer ds Point ; offset: $8 (8)
- denom ds Point ; offset: $C (12)
- sizeof EQU * ; size: $10 (16)
- ENDR
-
- ; typedef struct FMInput FMInput
- FMOutput RECORD 0
- errNum ds.w 1 ; offset: $0 (0)
- fontResult ds.l 1 ; offset: $2 (2)
- boldPixels ds.b 1 ; offset: $6 (6)
- italicPixels ds.b 1 ; offset: $7 (7)
- ulOffset ds.b 1 ; offset: $8 (8)
- ulShadow ds.b 1 ; offset: $9 (9)
- ulThick ds.b 1 ; offset: $A (10)
- shadowPixels ds.b 1 ; offset: $B (11)
- extra ds.b 1 ; offset: $C (12)
- ascent ds.b 1 ; offset: $D (13)
- descent ds.b 1 ; offset: $E (14)
- widMax ds.b 1 ; offset: $F (15)
- leading ds.b 1 ; offset: $10 (16)
- curStyle ds.b 1 ; offset: $11 (17)
- numer ds Point ; offset: $12 (18)
- denom ds Point ; offset: $16 (22)
- sizeof EQU * ; size: $1A (26)
- ENDR
-
- ; typedef struct FMOutput FMOutput
- ; typedef FMOutput *FMOutPtr
- FontRec RECORD 0
- fontType ds.w 1 ; offset: $0 (0) ;font type
- firstChar ds.w 1 ; offset: $2 (2) ;ASCII code of first character
- lastChar ds.w 1 ; offset: $4 (4) ;ASCII code of last character
- widMax ds.w 1 ; offset: $6 (6) ;maximum character width
- kernMax ds.w 1 ; offset: $8 (8) ;negative of maximum character kern
- nDescent ds.w 1 ; offset: $A (10) ;negative of descent
- fRectWidth ds.w 1 ; offset: $C (12) ;width of font rectangle
- fRectHeight ds.w 1 ; offset: $E (14) ;height of font rectangle
- owTLoc ds.w 1 ; offset: $10 (16) ;offset to offset/width table
- ascent ds.w 1 ; offset: $12 (18) ;ascent
- descent ds.w 1 ; offset: $14 (20) ;descent
- leading ds.w 1 ; offset: $16 (22) ;leading
- rowWords ds.w 1 ; offset: $18 (24) ;row width of bit image / 2
- sizeof EQU * ; size: $1A (26)
- ENDR
-
- ; typedef struct FontRec FontRec
- FMetricRec RECORD 0
- ascent ds.l 1 ; offset: $0 (0) ;base line to top
- descent ds.l 1 ; offset: $4 (4) ;base line to bottom
- leading ds.l 1 ; offset: $8 (8) ;leading between lines
- widMax ds.l 1 ; offset: $C (12) ;maximum character width
- wTabHandle ds.l 1 ; offset: $10 (16) ;handle to font width table
- sizeof EQU * ; size: $14 (20)
- ENDR
-
- ; typedef struct FMetricRec FMetricRec, *FMetricRecPtr, **FMetricRecHandle
- WidEntry RECORD 0
- widStyle ds.w 1 ; offset: $0 (0) ;style entry applies to
- sizeof EQU * ; size: $2 (2)
- ENDR
-
- ; typedef struct WidEntry WidEntry
- WidTable RECORD 0
- numWidths ds.w 1 ; offset: $0 (0) ;number of entries - 1
- sizeof EQU * ; size: $2 (2)
- ENDR
-
- ; typedef struct WidTable WidTable
- AsscEntry RECORD 0
- fontSize ds.w 1 ; offset: $0 (0)
- fontStyle ds.w 1 ; offset: $2 (2)
- fontID ds.w 1 ; offset: $4 (4) ;font resource ID
- sizeof EQU * ; size: $6 (6)
- ENDR
-
- ; typedef struct AsscEntry AsscEntry
- FontAssoc RECORD 0
- numAssoc ds.w 1 ; offset: $0 (0) ;number of entries - 1
- sizeof EQU * ; size: $2 (2)
- ENDR
-
- ; typedef struct FontAssoc FontAssoc
- StyleTable RECORD 0
- fontClass ds.w 1 ; offset: $0 (0)
- offset ds.l 1 ; offset: $2 (2)
- reserved ds.l 1 ; offset: $6 (6)
- indexes ds.b 48 ; offset: $A (10)
- sizeof EQU * ; size: $3A (58)
- ENDR
-
- ; typedef struct StyleTable StyleTable
- NameTable RECORD 0
- stringCount ds.w 1 ; offset: $0 (0)
- baseFontName ds.l 64 ; offset: $2 (2)
- sizeof EQU * ; size: $102 (258)
- ENDR
-
- ; typedef struct NameTable NameTable
- KernPair RECORD 0
- kernFirst ds.b 1 ; offset: $0 (0) ;1st character of kerned pair
- kernSecond ds.b 1 ; offset: $1 (1) ;2nd character of kerned pair
- kernWidth ds.w 1 ; offset: $2 (2) ;kerning in 1pt fixed format
- sizeof EQU * ; size: $4 (4)
- ENDR
-
- ; typedef struct KernPair KernPair
- KernEntry RECORD 0
- kernStyle ds.w 1 ; offset: $0 (0) ;style the entry applies to
- kernLength ds.w 1 ; offset: $2 (2) ;length of this entry
- sizeof EQU * ; size: $4 (4)
- ENDR
-
- ; typedef struct KernEntry KernEntry
- KernTable RECORD 0
- numKerns ds.w 1 ; offset: $0 (0) ;number of kerning entries
- sizeof EQU * ; size: $2 (2)
- ENDR
-
- ; typedef struct KernTable KernTable
- WidthTable RECORD 0
- tabData ds.l 256 ; offset: $0 (0) ;character widths
- fontResult ds.l 1 ; offset: $400 (1024) ;font record used to build table
- sExtra ds.l 1 ; offset: $404 (1028) ;space extra used for table
- style ds.l 1 ; offset: $408 (1032) ;extra due to style
- fID ds.w 1 ; offset: $40C (1036) ;font family ID
- fSize ds.w 1 ; offset: $40E (1038) ;font size request
- face ds.w 1 ; offset: $410 (1040) ;style (face) request
- device ds.w 1 ; offset: $412 (1042) ;device requested
- inNumer ds Point ; offset: $414 (1044) ;scale factors requested
- inDenom ds Point ; offset: $418 (1048) ;scale factors requested
- aFID ds.w 1 ; offset: $41C (1052) ;actual font family ID for table
- fHand ds.l 1 ; offset: $41E (1054) ;family record used to build up table
- usedFam ds.b 1 ; offset: $422 (1058) ;used fixed point family widths
- aFace ds.b 1 ; offset: $423 (1059) ;actual face produced
- vOutput ds.w 1 ; offset: $424 (1060) ;vertical scale output value
- hOutput ds.w 1 ; offset: $426 (1062) ;horizontal scale output value
- vFactor ds.w 1 ; offset: $428 (1064) ;vertical scale output value
- hFactor ds.w 1 ; offset: $42A (1066) ;horizontal scale output value
- aSize ds.w 1 ; offset: $42C (1068) ;actual size of actual font used
- tabSize ds.w 1 ; offset: $42E (1070) ;total size of table
- sizeof EQU * ; size: $430 (1072)
- ENDR
-
- ; typedef struct WidthTable WidthTable
- FamRec RECORD 0
- ffFlags ds.w 1 ; offset: $0 (0) ;flags for family
- ffFamID ds.w 1 ; offset: $2 (2) ;family ID number
- ffFirstChar ds.w 1 ; offset: $4 (4) ;ASCII code of 1st character
- ffLastChar ds.w 1 ; offset: $6 (6) ;ASCII code of last character
- ffAscent ds.w 1 ; offset: $8 (8) ;maximum ascent for 1pt font
- ffDescent ds.w 1 ; offset: $A (10) ;maximum descent for 1pt font
- ffLeading ds.w 1 ; offset: $C (12) ;maximum leading for 1pt font
- ffWidMax ds.w 1 ; offset: $E (14) ;maximum widMax for 1pt font
- ffWTabOff ds.l 1 ; offset: $10 (16) ;offset to width table
- ffKernOff ds.l 1 ; offset: $14 (20) ;offset to kerning table
- ffStylOff ds.l 1 ; offset: $18 (24) ;offset to style mapping table
- ffProperty ds.w 9 ; offset: $1C (28) ;style property info
- ffIntl ds.w 2 ; offset: $2E (46) ;for international use
- ffVersion ds.w 1 ; offset: $32 (50) ;version number
- sizeof EQU * ; size: $34 (52)
- ENDR
-
- ; typedef struct FamRec FamRec
- ;
- ; pascal void InitFonts(void)
- ;
- IF ¬ GENERATINGCFM THEN
- _InitFonts: OPWORD $A8FE
- ELSE
- IMPORT_CFM_FUNCTION InitFonts
- ENDIF
-
- ;
- ; pascal void GetFontName(short familyID, Str255 name)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetFontName: OPWORD $A8FF
- ELSE
- IMPORT_CFM_FUNCTION GetFontName
- ENDIF
-
- ;
- ; pascal void GetFNum(ConstStr255Param name, short *familyID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetFNum: OPWORD $A900
- ELSE
- IMPORT_CFM_FUNCTION GetFNum
- ENDIF
-
- ;
- ; pascal Boolean RealFont(short fontNum, short size)
- ;
- IF ¬ GENERATINGCFM THEN
- _RealFont: OPWORD $A902
- ELSE
- IMPORT_CFM_FUNCTION RealFont
- ENDIF
-
- ;
- ; pascal void SetFontLock(Boolean lockFlag)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetFontLock: OPWORD $A903
- ELSE
- IMPORT_CFM_FUNCTION SetFontLock
- ENDIF
-
- ;
- ; pascal FMOutPtr FMSwapFont(const FMInput *inRec)
- ;
- IF ¬ GENERATINGCFM THEN
- _FMSwapFont: OPWORD $A901
- ELSE
- IMPORT_CFM_FUNCTION FMSwapFont
- ENDIF
-
- ;
- ; pascal void SetFScaleDisable(Boolean fscaleDisable)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetFScaleDisable: OPWORD $A834
- ELSE
- IMPORT_CFM_FUNCTION SetFScaleDisable
- ENDIF
-
- ;
- ; pascal void FontMetrics(FMetricRecPtr theMetrics)
- ;
- IF ¬ GENERATINGCFM THEN
- _FontMetrics: OPWORD $A835
- ELSE
- IMPORT_CFM_FUNCTION FontMetrics
- ENDIF
-
- ;
- ; pascal void SetFractEnable(Boolean fractEnable)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetFractEnable: OPWORD $A814
- ELSE
- IMPORT_CFM_FUNCTION SetFractEnable
- ENDIF
-
- ;
- ; pascal short GetDefFontSize(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetDefFontSize
- dc.w $3EB8
- dc.w $0BA8
- dc.w $6604
- dc.w $3EBC
- dc.w $000C
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetDefFontSize
- ENDIF
-
- ;
- ; pascal Boolean IsOutline(Point numer, Point denom)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _IsOutline
- moveq #0,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION IsOutline
- ENDIF
-
- ;
- ; pascal void SetOutlinePreferred(Boolean outlinePreferred)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetOutlinePreferred
- moveq #1,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetOutlinePreferred
- ENDIF
-
- ;
- ; pascal Boolean GetOutlinePreferred(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetOutlinePreferred
- moveq #9,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetOutlinePreferred
- ENDIF
-
- ;
- ; pascal OSErr OutlineMetrics(short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _OutlineMetrics
- moveq #8,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION OutlineMetrics
- ENDIF
-
- ;
- ; pascal void SetPreserveGlyph(Boolean preserveGlyph)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetPreserveGlyph
- moveq #10,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetPreserveGlyph
- ENDIF
-
- ;
- ; pascal Boolean GetPreserveGlyph(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetPreserveGlyph
- moveq #11,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetPreserveGlyph
- ENDIF
-
- ;
- ; pascal OSErr FlushFonts(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _FlushFonts
- moveq #12,d0
- dc.w $A854
- EndM
- ELSE
- IMPORT_CFM_FUNCTION FlushFonts
- ENDIF
-
- ;
- ; pascal short GetSysFont(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetSysFont &dest=(sp)
- move.w $0BA6,&dest
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetSysFont
- ENDIF
-
- ;
- ; pascal short GetAppFont(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetAppFont &dest=(sp)
- move.w $0984,&dest
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetAppFont
- ENDIF
-
- ENDIF ; __FONTS__
-